import request from '@/utils/request'

// 新增：获取“正常、在库”装备的接口
export function listAvailableEquipments() {
  return request({
    url: '/equipment/equipment/dropdown', // 对应后端 Controller 的接口
    method: 'get'
  })
}

// 查询所有装备列表
export function listALLEquipment() {
  return request({
    url: '/equipment/equipment/listAll',
    method: 'get'
  });
}

// 查询装备管理列表
export function listEquipment(query) {
  return request({
    url: '/equipment/equipment/list',
    method: 'get',
    params: query
  })
}

// 查询装备管理详细
export function getEquipment(id) {
  return request({
    url: '/equipment/equipment/' + id,
    method: 'get'
  })
}

// 新增装备管理
export function addEquipment(data) {
  return request({
    url: '/equipment/equipment',
    method: 'post',
    data: data
  })
}

// 修改装备管理
export function updateEquipment(data) {
  return request({
    url: '/equipment/equipment',
    method: 'put',
    data: data
  })
}

// 删除装备管理
export function delEquipment(id) {
  return request({
    url: '/equipment/equipment/' + id,
    method: 'delete'
  })
}
